class ChemicalKGError(Exception):
    """基础异常类"""
    pass

class InvalidCASError(ChemicalKGError):
    """CAS号格式错误"""
    def __init__(self, cas: str, message: str = None):
        self.cas = cas
        self.message = message or f"无效的CAS号格式: {cas}"
        super().__init__(self.message)